SourceFormatX

Overview

Features

Why Use It

Formatting Show

Integration

Screenshots

Documentation

FAQs & Tips

Update History

Award Gallery

Testimonials

License Policy

CodeMorph

CodeToHtml

Java Source Code Obfuscation Show


SourceFormatX is not only the multi-language code formatter but also a code obfuscator that can obfuscate your Java and JSP source code for the purposes of source code security and intellectual property protection.

C/C++ Java C# Delphi (Pascal)
PHP JSP JavaScript HTML Components
CORBA IDL


  Java Source Code Obfuscation Examples:     Example 1   |   Example 2

This is Java code obfuscating sample, the purpose of it is to show the power of SourceFormatX Java Code Formatter's syntax parse engine.

  /* Before Code Obfuscating */

  package net.jforum.util;

  import java.security.MessageDigest;
  import java.security.NoSuchAlgorithmException;
  import net.jforum.exceptions.ForumException;

  /**
   * Encodes a string using MD5 hashing
   *
   * @author Rafael Steil
   * @version $Id: MD5.java,v 1.7 2006/08/23 02:13:44 rafaelsteil Exp $
   */

  public class MD5
  {
    /**
     * Encodes a string
     *
     * @param str String to encode
     * @return Encoded String
     * @throws NoSuchAlgorithmException
     */

    public static String crypt(String str)
    {
      if (str == null || str.length() == 0)
      {
        throw new IllegalArgumentException("String to encript cannot be null.");
      }

      StringBuffer hexString = new StringBuffer();

      try
      {
        MessageDigest md = MessageDigest.getInstance("MD5");
        md.update(str.getBytes());
        byte[] hash = md.digest();

        for (int i = 0; i < hash.length; i++)
        {
          if ((0xff & hash[i]) < 0x10)
          {
            hexString.append("0" + Integer.toHexString((0xFF & hash[i])));
          }
          else
          {
            hexString.append(Integer.toHexString(0xFF & hash[i]));
          }
        }
      }
      catch (NoSuchAlgorithmException e)
      {
        throw new ForumException("" + e);
      }

      return hexString.toString();
    }
  }


  /* After Code Obfuscating */

  package net.jforum.util;import java.security.MessageDigest;import
  java.security.NoSuchAlgorithmException;import
  net.jforum.exceptions.ForumException;public class MD5{public static String
  crypt(String str){if(str==null||str.length()==0){throw new
  IllegalArgumentException("String to encript cannot be null.");}StringBuffer
  hexString=new StringBuffer();try{MessageDigest md=MessageDigest.getInstance(
  "MD5");md.update(str.getBytes());byte[]hash=md.digest();for(int i=0;i<
  hash.length;i++){if((0xff&hash[i])<0x10){hexString.append("0"+
  Integer.toHexString((0xFF&hash[i])));}else{hexString.append(Integer.toHexString
  (0xFF&hash[i]));}}}catch(NoSuchAlgorithmException e){throw new ForumException(
  ""+e);}return hexString.toString();}}

Example 1   |   Example 2

  Download SourceFormatX Java Code Formatter to format and obfuscate all your Java source code files today!